require("../../assets/css/basic.less");
require("../../assets/css/normalize.css");
require("../../assets/css/property.css");
require("../../assets/css/reset.css");
require("../../assets/fonts/font-icon/iconfont.css");
require("../run/run.less");

const dom = require("../../libs/dom.js");
const axios = require("../../libs/axios.js");
const utils = require("../../libs/utils");
const INTERFACE_URL = "http://fitness.h5.itsource.cn:3701";
document.addEventListener("DOMContentLoaded", function () {
	utils.movementTopNav(".app-movement");
	// 添加页脚
	utils.footerPlugin(1);
	// 选择跑步类型
	utils.tabControl(".runBtns");
	//模拟go事件
	document.querySelector(".goBtn").addEventListener("click", function () {
		location.href = "./countdown.html"; //跳转到倒计时页面
	});
	// 显示地图
	utils.displayMap("map");

	// 渲染总里程
	axios.get("/api/exercise").then((res) => {
		console.log(res);
		dom.get(".run-distance").textContent = res.data.data.sum7Meter / 1000;
	});
});
